package com.tjtt.tdm.system.dao.impl;

import java.util.List;

import com.tjtt.tdm.base.HibernateEntityDAO;
import com.tjtt.tdm.exception.DaoException;
import com.tjtt.tdm.system.bean.Rolemenu;
import com.tjtt.tdm.system.dao.RoleMenuDao;

public class RoleMenuDaoImpl extends HibernateEntityDAO<Rolemenu> implements RoleMenuDao {
	public List<Rolemenu> findRoleMenuByMenuIdsAndRoleId(Long roleId,Long menuParentId) throws DaoException{
		String hql = "from Rolemenu as entity where entity.menuid in (select menu.menuid from Menu as menu where menu.parentid=?) and entity.roleid=?";
		return this.findByHql(hql,menuParentId,roleId);
	}
}
